Skip to content

Conversation

@GromNaN
Copy link
Member

@GromNaN GromNaN commented Nov 14, 2025

Q A
Type improvement
BC Break yes
Fixed issues #2762 (comment)

Summary

doctrine/cache is deprecated and archived.

Motivation for introducing a breaking change:

  • When installing doctrine/mongodb-odm with composer, you get a message even if doctrine/cache is not actively used.

Package doctrine/cache is abandoned, you should avoid using it. No replacement was suggested.

  • The next major version will require PHP 8.4.

This is a breaking change only when calling Configuration::getMetadataCacheImpl(). The workaround is easy: add doctrine/cache as project dependency.

I consider projects that use doctrine/cache directly without explicitly requiring the package to be in error.

That's why I'm adding a conflict with doctrine/mongodb-odm-bundle < 5, which did not have an explicit dependency but used the Doctrine\Common\Cache classes:
https://github.com/doctrine/DoctrineMongoDBBundle/blob/48c29009c24ff74c47782c0c9c2736f1f5fd9b0e/DependencyInjection/DoctrineMongoDBExtension.php#L14-L15

@GromNaN GromNaN added this to the 2.16.0 milestone Nov 14, 2025
@GromNaN GromNaN changed the title Stronger deprecation of doctrine/cache Move doctrine/cache to optional dependencies Nov 14, 2025
@GromNaN GromNaN changed the title Move doctrine/cache to optional dependencies [BC break] Move doctrine/cache to optional dependencies Nov 14, 2025
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quick fix and the proper fix should probably be mentioned in an upgrade guide.

@jmikola jmikola removed their request for review November 26, 2025 14:51
@GromNaN GromNaN enabled auto-merge (squash) November 29, 2025 19:00
Move doctrine/cache to optional dependencies

Add conflict with doctrine/mongodb-odm-bundle which uses doctrine/cache directly

https://github.com/doctrine/DoctrineMongoDBBundle/blob/48c29009c24ff74c47782c0c9c2736f1f5fd9b0e/DependencyInjection/DoctrineMongoDBExtension.php#L14-L15

Add upgrade instructions

Update UPGRADE-2.16.md

Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>

Update UPGRADE-2.16.md

Co-authored-by: Jeremy Mikola <jmikola@gmail.com>

Update UPGRADE-2.16.md

Co-authored-by: Jeremy Mikola <jmikola@gmail.com>

Deprecate `Configuration::getProxyDir` and `setProxyDir` (doctrine#2911)
@GromNaN GromNaN disabled auto-merge December 1, 2025 10:40
@GromNaN GromNaN enabled auto-merge (squash) December 1, 2025 10:41
@GromNaN GromNaN merged commit 1a5ea18 into doctrine:2.16.x Dec 1, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants